#include "stdio.h"
#include "string.h"

#define MAX_NAME_LENGTH 50  
#define MAX_PASSWORD_LENGTH 20 

struct date
{
    int year;
    int month;
    int day;
};

struct student
{
    int id;
    char name[MAX_NAME_LENGTH];
    char sex;
    double math_score;
    double chinese_score;
    struct date birthday;
};

void print_student(struct student stu)
{
    printf("id: %d\n", stu.id);
    printf("name: %s\n", stu.name);
    printf("sex: %c\n", stu.sex);
    printf("math_score: %.2f\n", stu.math_score);
    printf("chinese_score: %.2f\n", stu.chinese_score);
    printf("birthday: %d-%d-%d\n", stu.birthday.year, stu.birthday.month, stu.birthday.day);
    printf("\n");
}

int main(){

    struct student stu = {
        1, "zhangsan", 'm', 90.5, 87,{2018, 3, 4}
    };

    print_student(stu);

    stu.id = 3;
    strcpy(stu.name, "lisi");
    print_student(stu);
        
    return 0;
}